home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 018a / pkansi.zip / PKANSI.DOC < prev    next >
Text File  |  1993-02-23  |  17KB  |  392 lines

  1.  
  2.  
  3. PKANSI.ZIP - Uploaded to EXEC-PC 2/93 by Mark "Pinky" Schulz
  4.  
  5. This  zipfile contains: 
  6. 1. PKANSI.DOC - Tutorial on implementing ANSI escape sequences and
  7.                 RAM disks. 
  8. 2. PKEY.TXT - ANSI escape codes for adding "PKZIP/UNZIP" key commands.
  9. 3. CONFIG.MS4 - Example MS-DOS 4.01 CONFIG.SYS file
  10. 4. CONFIG.MS5 - Example MS-DOS 5.00 CONFIG.SYS file
  11. 5. CONFIG.DR6 - Example DR-DOS 6.00 CONFIG.SYS file
  12. 6. AUTOEXEC.BAT - Example AUTOEXEC.BAT file
  13. 7. DATACOM.BAT - Example SET-UP/UNZIP/START batch file.
  14.  
  15. Are you feeling too emcumbered by the over-involved menus with "PK"
  16. commands?  Perhaps you're typing "pkunzip..." too often at the
  17. command prompt?  Is your hard disk light constantly lit?  Do you
  18. think it's time to upgrade?  This little DOS refresher should jar loose 
  19. some cobwebs about the use of ANSI escape sequences which redefine keys
  20. as well as how to get better use of all that extra RAM you paid for when
  21. you bought your computer.
  22.  
  23. A "PKUNZIP..." command will now be a keystroke away.
  24.  
  25. This is especially handy if your files are stored as .zip's on your disk
  26. and unzipped into a RAM disk for use.  This eliminates some worry over 
  27. viruses, as well as saving disk space.  Your DOS probably has a RAM disk
  28. included as an installable device driver.  Only 4 MEG RAM extension is
  29. required for most non-windows applications.  Many will get by with as
  30. little as 1 MEG.  The viruses are then contained in the RAM disk and get 
  31. no access to the contents of your storage drive.  When the computer is
  32. turned off, the contents of the RAM disk (along with any viruses)
  33. disappear from the system.  Extra care must be taken to ZIP any files
  34. generated during the session to the storage drive using the keystroke
  35. commands.  More details on the use of RAM disks can be found at the end
  36. of this file.  Now, let's discuss keystroke commands...
  37.  
  38. Make sure the ANSI.SYS file is present in the DOS directory of your boot 
  39. drive.  To use ANSI escape sequences, you must first add the following
  40. lines to your CONFIG.SYS and AUTOEXEC.BAT file prior to rebooting:
  41.  
  42. CONFIG.SYS:
  43. DEVICE=C:\DOS\ANSI.SYS 
  44.  
  45. Copy the PKEY.TXT file to the root directory of your boot drive
  46. and add the following line near the end of your AUTOEXEC.BAT: 
  47.  
  48. TYPE C:\PKEY.TXT
  49.  
  50. There are example CONFIG.SYS and AUTOEXEC.BAT files included which
  51. can serve as a good starting point for constructing your boot files.
  52. Refer to the RAM DISK section of this text.
  53.  
  54. WARNING:
  55. Please note that "typing" THIS file at the command prompt after ANSI.SYS
  56. is installed will result in the redefinition of the "F" keys per the
  57. sequences at the end of this section.  Use an ASCII file viewer or text 
  58. editor to read any files containing ANSI escape sequences. Using the DOS 
  59. TYPE command at the command prompt will result in the execution of the 
  60. sequences.
  61.  
  62. If you opt to use the PKEY.TXT file "as is", after rebooting, the 
  63. following keystrokes at the command prompt will automatically type 
  64. in these commands:
  65.  
  66.    KEYSTROKE                      COMMAND
  67.       
  68.     CTRL-F1            PKUNZIP (followed by a SPACE) 
  69.     CTRL-F2            PKZIP -EX (followed by a SPACE) 
  70.     CTRL-F3            PKUNZIP -D (followed by a SPACE) 
  71.     CTRL-F4            PKZIP -RPEX (followed by a SPACE)
  72.     CTRL-F5            DIR A:\*.ZIP/P (followed by a RETURN)
  73.     CTRL-F6            DIR B:\*.ZIP/P (followed by a RETURN)
  74.     CTRL-F7            DIR C:\*.ZIP/P (followed by a RETURN)
  75.     CTRL-F8            DIR D:\*.ZIP/P (followed by a RETURN)
  76.  
  77. The commands followed by a SPACE allow further entry before the manual
  78. RETURN is entered.  The commands followed by the RETURN character are 
  79. automatically typed and entered.
  80.  
  81. **********************************************************************
  82.  
  83. Now that the "quick start" is out of the way, what exactly is an ANSI
  84. escape sequence?
  85.  
  86. An ANSI escape sequence is a series of characters (beginning with an 
  87. escape character or keystroke) developed by the American National 
  88. Standards Institute.  These sequences are used to define functions for 
  89. DOS.  Specifically, you can change graphics functions (i.e., the ANSI 
  90. screen mode when logging on to the BBS), redefine keys, etc.
  91. What follows will discuss the ANSI escape sequence as it relates to 
  92. redefining keys.  To get more information on other ANSI functions, refer 
  93. to the installable device driver section of your DOS documentation.
  94.  
  95. The general form of the ANSI escape sequence is:
  96. 1. A one-byte "ESC" character (hexadecimal 1BH).
  97. 2. A one-byte "[" character (hexadecimal 5BH).
  98. 3. One or more decimal numbers separated by semicolons.
  99.    When assigning keys, you can use extended character codes by typing
  100.    the first variable in the sequence as 0 (NUL) followed by the second
  101.    key. (i.e., 0;68; is the F10 key)  Refer to the table below.
  102.    Once the key is identified, any following characters contained in
  103.    quotation marks redefine the key.
  104. 4. A single command character which defines the type of ANSI function.
  105.    To redefine a key, this character is "p".
  106.  
  107.  
  108.           Extended Character Code Table (0;xxx;)
  109.  
  110.             KEY  ALONE  +SHIFT  +CTRL   +ALT
  111.  
  112.             F1    59      84      94     104
  113.             F2    60      85      95     105
  114.             F3    61      86      96     106
  115.             F4    62      87      97     107
  116.             F5    63      88      98     108
  117.             F6    64      89      99     109
  118.             F7    65      90     100     110
  119.             F8    66      91     101     111
  120.             F9    67      92     102     112 
  121.             F10   68      93     103     113
  122.  
  123.  
  124. The PKEY.TXT file included in this .zip works as outlined above after 
  125. the ANSI.SYS is installed.  You can modify or add keys and functions 
  126. to your personal preferences using a text editor which allows entering 
  127. control characters into the text.  If your editor does not have this 
  128. feature, chances are it will allow you to copy lines and edit only 
  129. those characters which will change the key or function.  Please note 
  130. the first two characters of each command are always the same and are 
  131. necessary to complete a valid ANSI escape sequence.  You can use the 
  132. PKEY.TXT file as the source for your editing endeavors, provided you 
  133. do not attempt to alter the first two characters of each command.  
  134. Also note a valid key redefinition must always end with a "p".
  135.  
  136. EXAMPLE:
  137.  
  138. The PKEY.TXT file as zipped reads:
  139.  
  140.      TEXT IN FILE                           MEANING
  141. 4;"pkunzip";32p             CTRL-F1 = PKUNZIP + SPACE
  142. 5;"pkzip -ex";32p           CTRL-F2 = PKZIP -EX + SPACE
  143. 6;"pkunzip -d";32p          CTRL-F3 = PKUNZIP -D + SPACE
  144. 7;"pkzip -rpex";32p         CTRL-F4 = PKZIP -RPEX + SPACE
  145. 8;"dir a:\*.zip/p";13p      CTRL-F5 = DIR A:\*.ZIP/P + RETURN
  146. 9;"dir b:\*.zip/p";13p      CTRL-F6 = DIR B:\*.ZIP/P + RETURN
  147. 00;"dir c:\*.zip/p";13p     CTRL-F7 = DIR C:\*.ZIP/P + RETURN
  148. 01;"dir d:\*.zip/p";13p     CTRL-F8 = DIR D:\*.ZIP/P + RETURN
  149.  
  150. You want the directory command for drive C: to become C:\ZIP.
  151. You want the SHIFT-Fxx keystrokes to do your commands.
  152. You don't have a drive D:
  153.  
  154. To change the drive C: directory command, edit line 7 of PKEY.TXT to:
  155.  
  156. 00;"dir c:\zip\*.zip/p";13p
  157.  
  158. To change the keys to be redefined, change the 94-101 entries to 84-90:
  159. (Line 8 has been deleted to eliminate the drive D: directory command.)
  160.  
  161.       TEXT IN FILE                              MEANING
  162. 4;"pkunzip";32p                SHIFT-F1 = PKUNZIP + SPACE
  163. 5;"pkzip -ex";32p              SHIFT-F2 = PKZIP -EX + SPACE
  164. 6;"pkunzip -d";32p             SHIFT-F3 = PKUNZIP -D + SPACE
  165. 7;"pkzip -rpex";32p            SHIFT-F4 = PKZIP -RPEX + SPACE
  166. 8;"dir a:\*.zip/p";13p         SHIFT-F5 = DIR A:\*.ZIP/P + RET
  167. 9;"dir b:\*.zip/p";13p         SHIFT-F6 = DIR B:\*.ZIP/P + RET
  168. 0;"dir c:\zip\*.zip/p";13p     SHIFT-F7 = DIR C:\ZIP\*.ZIP/P + RET
  169.  
  170. Some programs may disable or overwrite pending reassignments upon their
  171. execution.  To reinstate your original definitions, type this command
  172. at the command prompt:
  173.  
  174. TYPE PKEY.TXT
  175.  
  176. ----------------------------------------------------------------------
  177.  
  178. MORE ON RAM DISKS...
  179.  
  180. The extemded RAM in your computer is often idle amd unused if no
  181. steps are taken to include it at boot up.  Some programs look for
  182. RAM controlled by the EMM386.SYS or HIMEM.SYS.  If it is not found,
  183. the extended or expanded RAM simply isn't used, and the program
  184. defaults back to setting up virtual memory on your hard disk.
  185. If the program is larger than system RAM, the computer must also
  186. read the hard disk each time a new function or command is executed.
  187. This not only slows the computer, but inflicts unnecessary wear and
  188. tear on your hard drive.  Watch to see how many times the hard disk
  189. indicator light flashes in the course of executing a program. 
  190. Whenever that light is lit, the hard disk is operating.
  191.  
  192. The mechanical drives are well suited for data storage, but fall
  193. far short in performance as "working drives" compared to the speed
  194. of a RAM disk.  What can be misconstrued as a poorly performing
  195. computer is probably a poorly configured computer.  
  196.  
  197. When a RAM disk is set-up in your system, the computer "sees" it as
  198. just another drive.  Functionally, it is no different from your
  199. floppies or hard drive... the only difference being the contents of
  200. the RAM disk are temporary and stay intact only as long as the
  201. computer is on.  The speed factor, however, is 20 to 50 times 
  202. faster than the floppies or hard drive.
  203. ****************************************************************
  204. Where do you get the software for installing a RAM disk?
  205.  
  206. Look no further than the DOS you have.
  207.  
  208. MS-DOS 4.01 has a RAMDRIVE.SYS which requires no EMM or HIMEM.
  209. MS-DOS 5.00 has a RAMDRIVE.SYS which requires EMM386.EXE.
  210. DR-DOS 6.00 has a VDISK.SYS which requires no EMM, but "looks"
  211.  for a string in the CONFIG.SYS file and can be used with
  212.  MS-DOS 4.01 and 5.00.
  213. ****************************************************************
  214. How do you install a RAM disk?
  215.  
  216. First, you must determine how much extended RAM is installed on
  217. your computer.  This can be seen at the boot-up screen. 
  218. Another method is to run a MEM command at the command prompt.
  219. If extended memory is present, the MEM command will display the
  220. number of bytes installed.  Divide this number by 1024 to 
  221. determine the "K" value.  (i.e., 7424K = 7602176 bytes)
  222. Use the larger number to do this calculation; it reflects the
  223. number of bytes present at boot-up.
  224.  
  225. If no extended RAM is installed, check into having some added.
  226. Buying RAM can be less costly than replacing a worn hard drive.
  227.  
  228. The "K" value you have determined is the largest RAM disk you
  229. can install at boot-up.  It is not necessary to use every byte
  230. of extended memory when installing a disk, and more than one
  231. disk may be installed by adding more device statements to your
  232. CONFIG.SYS file.
  233.  
  234. Second, modify your CONFIG.SYS file to include the size and
  235. number of disks you want installed:
  236.  
  237. MS-DOS 4.01: (This text is zipped as CONFIG.MS4)
  238. files=24
  239. buffers=32
  240. device=c:\dos\ansi.sys
  241. device=c:\dos\ramdrive.sys 3456,512,128/e
  242. device=c:\dos\ramdrive.sys 3456,512,128/e
  243.  
  244. MS-DOS 5.00: (This text is zipped as CONFIG.MS5)
  245. files=24
  246. buffers=32
  247. device=c:\dos\emm386.exe
  248. device=c:\dos\ansi.sys
  249. device=c:\dos\ramdrive.sys 6912,512,128/e
  250.  
  251. DR-DOS 6.00: (This text is zipped as CONFIG.DR6)  
  252. files=24
  253. fastopen=512
  254. ?"Two Ramdisks? (Y/N)"goto emm
  255. buffers=32
  256. ?"ANSI? (Y/N)"device=a:\ansi.sys
  257. device=a:\vdisk.sys 6912,512,128/e
  258. goto end
  259. :emm
  260. ?"Include EMM? (Y/N)"device=a:\emm386.sys /f=auto /kb=7424 /bdos=auto
  261. hidos=on
  262. ?"ANSI? (Y/N)"hidevice=a:\ansi.sys
  263. hidevice=a:\vdisk.sys 3456,512,128/e
  264. hidevice=a:\vdisk.sys 3456,512,128/e
  265. hibuffers=32
  266. :end
  267. ********************************************************************
  268. What do the numbers and options mean after the DEVICE=RAMDRIVE.SYS
  269. and DEVICE=VDISK.SYS statements?
  270.  
  271. The 4-digit number represents the size of the RAM disk in "K".
  272. This number should be divisible by 64, and doesn't need to be 
  273. 4 digits.  The MS-DOS 4.01 RAMDRIVE is limited to 4 MEG in size.
  274. If you wish more disks to be available, run more device statements.
  275.  
  276. The 512 represents the sector size on the disk in bytes.
  277.  
  278. The 128 means there's directory space allocated for 128 entries
  279. in the root directory of the RAM disk.  If more entries are
  280. required, make a sub-directory.
  281.  
  282. The /e option means the disk is installled in extended memory.
  283. Use /a to install MS-DOS Ramdrive in expanded memory.
  284. Use /x to install DR-DOS Vdisk in expanded memory.
  285. *******************************************************************
  286. Where's my SHELL=C:\COMMAND.COM statement?
  287.  
  288. It's gone now.  We'll copy the COMMAND.COM file to the RAM disk and 
  289. run a SET COMSPEC=D:\COMMAND.COM command in the AUTOEXEC.BAT file.
  290. Now when the computer looks for COMMAND.COM, it will find it in the 
  291. RAM disk, making it unnecessary to access the hard drive for 
  292. internal DOS commands. 
  293. *******************************************************************
  294. What will my AUTOEXEC.BAT look like?
  295.  
  296. Something like this: (This text is zipped as AUTOEXEC.BAT)
  297.  
  298. AUTOEXEC.BAT
  299. REM Copy and change COMMAND.COM path - include your environment
  300. REM setting(s) in this section.
  301. @copy c:\command.com d:
  302. @set comspec=d:\command.com
  303. REM Copy your PKZIP/UNZIP files to RAM disk - copy or unzip any 
  304. REM favorite utilities, editor, or DOS externals in this section.
  305. @copy c:\pk*.exe d:
  306. @copy c:\dos\more.com d:
  307. REM Include the RAM disk(s) in PATH statement
  308. @set path=d:\;c:\;c:\dos\
  309. REM The Requisite
  310. @prompt $p$g
  311. @c:\mouse
  312. REM Type out your ANSI escape sequence file and clear the screen
  313. @type c:\pkey.txt
  314. @cls
  315. REM Change current directory to RAM disk
  316. @d:
  317. *****************************************************************
  318. I don't use some programs which require special environment
  319. settings at every session.  Should I include those settings
  320. in the AUTOEXEC.BAT file?
  321.  
  322. You may want to add any additional environment settings relevant
  323. to the software you seldom use in a separate SET-UP/UNZIP/START
  324. batch file: (This text is zipped as DATACOM.BAT) 
  325.  
  326. C:\DATACOM.BAT
  327. @set bitcom=d:\bitcom
  328. @set bitfax=d:\bitfax
  329. @set recvfax=d:\recvfax
  330. @set path=d:\;d:\bitcom\;d:\bitfax\;c:\;c:\dos
  331. @pkunzip -d c:\zip\datacom d:
  332. @md d:\recvfax
  333. @cd\
  334. @d:
  335. @comshell
  336.  
  337. It will be necessary to ZIP your DATACOM files into recursed
  338. sub-directories using the (F4) PKZIP -RPEX keystroke command.
  339. It may be more convenient to copy these files into an empty
  340. RAM disk before zipping.
  341.  
  342. After copying this .BAT to the root directory of your boot drive,
  343. typing "DATACOM" will set-up the environment, unzip the program 
  344. into recursed sub-directories on the RAM disk, make a receive fax
  345. directory, switch the current directory to the RAM disk, and start 
  346. the program.  
  347.  
  348. Note these settings will stay in effect until the next environment 
  349. adjustments are made or until the computer is turned off or reset.
  350. ******************************************************************** 
  351. What are all these "@" characters preceding the .BAT commands?
  352.  
  353. They're suppressing the display of commands when run.  If you want
  354. visual feedback from these .BAT files, delete these characters.
  355. ********************************************************************
  356. Now I can put my applications in the RAM disk?
  357.  
  358. Just copy or unzip any and all applications you intend to use at 
  359. one session into the RAM disk(s).  For example, you can unzip your
  360. CAD program into drive D: and use drive E: for drawing files.
  361. You'll notice far less hard drive accesses, and improved speed.
  362. Note how fast EXDB (the EXEC-PC database) runs now.
  363.  
  364. Possible viruses are now quarantined away from your storage disk(s).
  365. ********************************************************************
  366. Are there any limitations DOS-wise with a RAM disk? 
  367.  
  368. You can run any normal DOS commands on the files in a RAM disk.
  369. Do not attempt to run a CHKDSK command there.  The medium isn't
  370. appropriate to the function.  A disk optimizer will work, though.
  371. ********************************************************************
  372. My computer can boot from drive A: into the 640K system RAM.
  373. Do I really need a hard disk?  Or a RAM disk for that matter?
  374.  
  375. No.  Analyze your requirements and specify your options accordingly.   
  376. ********************************************************************
  377. I noticed you use an alias... are you a criminal or a schizo?
  378.  
  379. You could ask if you were neither?
  380. ********************************************************************
  381. "And the ass saw the angel..." -- Numbers 22:23
  382.  
  383. "And when the ass saw the angel..." -- Numbers 22:25
  384. *********************************************************************
  385.  
  386. I hope this upload has been some assistance to you. The techniques 
  387. outlined here have greatly increased the ease with which I use my 
  388. computer and trust you will also benefit from them.   
  389.                                           
  390.                                              --PINKY (Frequent Flyer)
  391.  
  392.